/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package csgui.entities;

import csgui.ArchitectureEnum;
import csgui.OperatingSystemEnum;
import csgui.ResourceCharacteristicsEnum;
import java.util.Collection;
import java.util.TimeZone;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

/**
 *
 * @author robert
 */
@Entity
public class ComputingResource extends GridSimEntity{
    @Basic protected ArchitectureEnum architecture;
    @Basic protected OperatingSystemEnum operatingSystem;
    @Basic protected TimeZone timeZone;
    @Basic protected Integer cost;
    @Basic protected Double peakLoad;
    @Basic protected Double offPeakLoad;
    @Basic protected Double holidayLoad;
    @Basic protected ResourceCharacteristicsEnum characteristic;
    @ManyToMany protected Collection<Weekend> weekendDays;
    @ManyToMany protected Collection<Holiday> holidays;
    @OneToOne protected Broker broker;
    @OneToMany protected Collection<Machine> machines;
    
    public ComputingResource()
    {
    }

    public Collection<Machine> getMachines() {
        return machines;
    }

    public void setMachines(Collection<Machine> machines) {
        this.machines = machines;
    }
    
    public Broker getBroker() {
        return broker;
    }

    public void setBroker(Broker broker) {
        this.broker = broker;
    }
    
    public ResourceCharacteristicsEnum getCharacteristic() {
        return characteristic;
    }

    public void setCharacteristic(ResourceCharacteristicsEnum characteristic) {
        this.characteristic = characteristic;
    }
    
    public ArchitectureEnum getArchitecture() {
        return architecture;
    }

    public void setArchitecture(ArchitectureEnum architecture) {
        this.architecture = architecture;
    }

    public OperatingSystemEnum getOperatingSystem() {
        return operatingSystem;
    }

    public void setOperatingSystem(OperatingSystemEnum operatingSystem) {
        this.operatingSystem = operatingSystem;
    }

    public TimeZone getTimeZone() {
        return timeZone;
    }

    public void setTimeZone(TimeZone timeZone) {
        this.timeZone = timeZone;
    }

    public Integer getCost() {
        return cost;
    }

    public void setCost(Integer cost) {
        this.cost = cost;
    }

    public Double getPeakLoad() {
        return peakLoad;
    }

    public void setPeakLoad(Double peakLoad) {
        this.peakLoad = peakLoad;
    }

    public Double getOffPeakLoad() {
        return offPeakLoad;
    }

    public void setOffPeakLoad(Double offPeakLoad) {
        this.offPeakLoad = offPeakLoad;
    }

    public Double getHolidayLoad() {
        return holidayLoad;
    }

    public void setHolidayLoad(Double holidayLoad) {
        this.holidayLoad = holidayLoad;
    }

    public Collection<Weekend> getWeekendDays() {
        return weekendDays;
    }

    public void setWeekendDays(Collection<Weekend> weekendDays) {
        this.weekendDays = weekendDays;
    }

    public Collection<Holiday> getHolidays() {
        return holidays;
    }

    public void setHolidays(Collection<Holiday> holidays) {
        this.holidays = holidays;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ComputingResource)) {
            return false;
        }
        ComputingResource other = (ComputingResource) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "csgui.entities.ComputingResource[ id=" + id + " ]";
    }
    
}
